﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NaireSystem.Api.VO;
using NaireSystem.Datas;
using TYBase;

namespace NaireSystem.Api
{
    public class OfficeApi
    {
        public static R<List<Public_officeVO>> GetListDeptInfo()
        {
            try
            {
                LocalHttp http = new LocalHttp();
                if (!http.SetBaseUri(AppData.Url)
                    .SetUrl($"/office/getListDeptInfo") 
                    .SetGet().Excute(out string data))
                {
                    return R<List<Public_officeVO>>.Fail(data);
                }
                return data.AsModel<R<List<Public_officeVO>>>();
            }
            catch (Exception ex)
            {
                return R<List<Public_officeVO>>.Fail("获取部门列表失败!!", ex);
            }
        }
    }
}
